<template>
	<view class="grade u-skeleton" :style="{
		'background-image':'url(' + $util.img('/static/img/grade/bg.png') + ')'
	}">
		<u-navbar back-icon-color="#fff" title="等级" title-color='#fff' :background="{
			'backgroundColor':'rgba(0,0,0,0)'
		}" :borderBottom="false" class="u-skeleton-rect"></u-navbar>
		<view class="title u-skeleton-rect">升级达人享受更多权益 </view>
		<view class="tips u-skeleton-rect">完成任务即可升级权益 </view>
		<view class="info-img u-skeleton-rect" :style="{
		'background-image':'url(' + $util.img('/static/img/grade/info.png') + ')'
	}">
			<view class="left">
				<view class="txt">我的达人等级</view>
				<view class="txt">{{info.level_name}}</view>
			</view>
			<image class="img-right" :src="$util.img('/static/img/grade/等级.png')" mode="widthFix"></image>
		</view>
		<view class="bottom-content u-skeleton-rect">
			<view class="i-title">当前权益</view>
			<view class="c-tips">1.获得矿山直推速率收益:{{info.current_ks_z_rebate}}%</view>
			<view class="c-tips">2.获得矿山间推速率收益:{{info.current_ks_j_rebate}}%</view>
			<view class="c-tips">3.获得矿场直推速率收益:{{info.current_kc_z_rebate}}%</view>
			<view class="c-tips">4.获得矿场间推速率收益:{{info.current_kc_j_rebate}}%</view>
		</view>
		<view class="invite u-skeleton-rect">
			<view class="i-title">{{info.next_level_name}}</view>
			<view class="i-bottom">
				<view class="ib-left">
					<view class="box-num">
						<view class="info-num" :style="{
						'width': info.my_num / info.next_num * 100 + '%'
					}"></view>
					</view>
					<view class="num" >{{info.my_num}}/{{info.next_num}}</view>
				</view>
				<view class="ib-right"  @click="$util.redirectTo('/pages/my/invite')">邀请好友</view>
			</view>
		</view>
		<view class="bottom-content u-skeleton-rect">
			<view class="i-title">{{info.next_level_name}}</view>
			<view class="c-tips">1.获得矿山直推速率收益:{{info.ks_z_rebate}}%</view>
			<view class="c-tips">2.获得矿山间推速率收益:{{info.ks_j_rebate}}%</view>
			<view class="c-tips">3.获得矿场直推速率收益:{{info.kc_z_rebate}}%</view>
			<view class="c-tips">4.获得矿场间推速率收益:{{info.kc_j_rebate}}%</view>
		</view>
		<u-skeleton :loading="loding" :animation="true" bgColor="#FFF"></u-skeleton>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				loding: true,
				info:{}
			}
		},
		onLoad() {
			this.getinfo();
		},
		methods:{
			getinfo(){
				this.$http.asyncSendrequest({
					url:'/profile/levelDetail',
					success:res=>{
						this.info = res.data;
						this.loding = false;
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.grade{
		width: 100%;
		min-height: 100vh;
		background-size: 100% 100%;
		background-repeat: no-repeat;
		padding-bottom: 30rpx;
		.title{
			margin: 100rpx 40rpx 0;
			font-size: 38rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;
			margin-bottom: 26rpx;
		}
		.tips{
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			opacity: 0.5;
			margin: 20rpx 40rpx 0;
		}
		.info-img{
			margin:100rpx 26rpx 30rpx;
			height: 167rpx;
			background-size: 100% 100%;
			background-repeat: no-repeat;
			padding: 36rpx 72rpx 0;
			box-sizing: border-box;
			position: relative;
			.left{
				.txt{
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: bold;
					color: #AB7938;
					margin-bottom: 10rpx;
				}
			}
			.img-right{
				position: absolute;
				width: 280rpx;
				bottom: 28rpx;
				right: 50rpx;
			}
		}
		.invite{
			margin: 30rpx;
			height: 200rpx;
			background: #191725;
			border-radius: 20rpx;
			padding: 50rpx 46rpx 0 38rpx;
			box-sizing: border-box;
			.i-title{
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #E7C79D;
			}
			.i-bottom{
				display: flex;
				align-items: center;
				justify-content: space-between;
				.ib-left{
					display: flex;
					align-items: center;
					.box-num{
						width: 260rpx;
						height: 8rpx;
						background: #FFFFFF;
						border-radius: 4rpx;
						overflow: hidden;
						.info-num{
							height: 100%;
							background: #ECC395;
						}
					}
					.num{
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #FFFFFF;
						margin-left: 28rpx;
					}
				}
				.ib-right{
					width: 180rpx;
					height: 60rpx;
					background: linear-gradient(-90deg, #DBB27B, #F5DFC3);
					border-radius: 10rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					line-height: 60rpx;
					color: #000000;
				}
			}
		}
		.bottom-content{
			margin: 0 30rpx;
			min-height: 280rpx;
			background: #191725;
			border-radius: 20rpx;
			padding: 50rpx 46rpx 40rpx 38rpx;
			box-sizing: border-box;
			.i-title{
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #E7C79D;
			}
			.c-tips{
				margin-top: 24rpx;
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
			}
			
		}
	}
</style>